package com.kingdee.shr.ques.cloud.poi.entity;

import java.io.Serializable;

/**
 * @author Miaoxiong Fan
 * @description excel文件信息
 * @data 2019/2/25
 */
public class ExcelDetail implements Serializable {
    private static final long serialVersionUID = 4775206630536186009L;
    private int fileIndex;
    private int total;
    private int success;
    private int failure;

    public ExcelDetail() {
    }

    public ExcelDetail(int fileIndex, int total) {
        this.fileIndex = fileIndex;
        this.total = total;
    }

    public int getFileIndex() {
        return fileIndex;
    }

    public void setFileIndex(int fileIndex) {
        this.fileIndex = fileIndex;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public void incSuccess(int process) {
        if(process + success + failure > total) {
            this.success = total - failure;
        }else {
            this.success += process;
        }
    }

    public int getFailure() {
        return failure;
    }

    public void setFailure(int failure) {
        this.failure = failure;
    }

    public void incFailure(int process) {
        if(process + success + failure > total) {
            this.failure = total - success;
        }else {
            this.failure += process;
        }
    }
}
